package jdbc.day01;

import Utils.DruidJDBCUtils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class DruidJdbcDemo {
    public static void main(String[] args) {
        PreparedStatement pre=null;
        Connection conn=null;
        try {
            conn = DruidJDBCUtils.getConnection();
            pre = conn.prepareStatement("update student set name='张秋雨' where id=?");
            pre.setInt(1,1);
            int i = pre.executeUpdate();
            System.out.println(i);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }finally {
            DruidJDBCUtils.close(pre,conn);
        }
    }
}
